withEndAction
Specifies an action to take place when the next animation ends. The action is only run if the animation ends normally; if the ViewPropertyAnimator is canceled during that animation, the runnable will not run. This method, along with withStartAction, is intended to help facilitate choreographing ViewPropertyAnimator animations with other animations or actions in the application.
For example, the following code animates a view to x=200 and then back to 0:
Runnable endAction = new Runnable() {
public void run() {
view.animate().x(0);
}
};
view.animate().x(200).withEndAction(endAction);
Content copied to clipboard
For API 14 and 15, this method will run by setting a listener on the ViewPropertyAnimatorCompat object and running the action in that listener's onAnimationEnd method.
Return
This object, allowing calls to methods in this class to be chained.
Parameters
runnable
The action to run when the next animation ends.